<?php
class Wxjssdk {
  public function getAccessToken() {
	  
   $data = F('access_token');
    //时间判断是否在7200内过期
   if(!$data['time']||$data['time']< time()) {
      $access_token = curl_file_get_contents(C('zyb_wx_url')."index.php?m=api&a=getToken");
	  $access_token =json_decode($access_token,true);
      if($access_token['data']) {
        $data['time'] =time()+$access_token['data']['time']-$access_token['data']['curtime'];
        $data['token'] = $access_token['data']['token'];
		F('access_token',$data);
      }
    }
    return $data['token'];
  }

}